<template>
  <div class="menu">
    <div class="menu_logo">
      <div class="logo_sty">
        <img src="../assets/img/logo.png" alt="">
      </div>
    </div>
    <div class="menu_menu">
      <el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose"
               :collapse="isCollapse">
        <router-link to="/Student">
          <el-menu-item index="1">
            <i class="el-icon-s-home"></i>
            <span slot="title">首页</span>
          </el-menu-item>
        </router-link>
        <el-submenu index="2">
          <template slot="title">
            <i class="el-icon-s-management"></i>
            <span slot="title">个人作品管理</span>
          </template>
          <router-link to="/Opus/Submit" class="link_cancelUnderline">
            <el-menu-item-group>
              <el-menu-item index="2-1">作品上传</el-menu-item>
            </el-menu-item-group>
          </router-link>
          <router-link to="/Opus/Management" class="link_cancelUnderline">
            <el-menu-item-group>
              <el-menu-item index="2-2">作品管理</el-menu-item>
            </el-menu-item-group>
          </router-link>
        </el-submenu>
        <router-link to="/Person/ModiifyInformation">
          <el-menu-item index="3">
            <i class="el-icon-user-solid"></i>
            <span slot="title">个人信息</span>
          </el-menu-item>
        </router-link>
        <router-link to="/login">
          <el-menu-item index="4">
            <i class="el-icon-switch-button" style="font-weight: bold"></i>
            <span slot="title">退出</span>
          </el-menu-item>
        </router-link>
      </el-menu>
    </div>
    <div class="right_content">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "Menu",
  data() {
    return {
      isCollapse: true
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    }
  }
}
</script>

<style lang="less" scoped>
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}

.menu {
  width: 100%;
  height: 100%;
  position: absolute;

  .menu_menu {
    margin-top: 10%;
    width: 5%;
    //background-color: grey;
    position: absolute;
  }

  .menu_logo {
    background-color: black;
    //border: 1px solid #ffffff;
    //border-radius: 5px；

    .logo_sty {
      display: flex;
      justify-content: center;

      img {
        width: 20%;
        //margin-left: 38%;
      }
    }

  }

  .right_content {
    width: 80%;
    margin-left: 8%;
    position: absolute;
    margin-top: 7%;
  }
}
</style>
